<?php $this->renderPartial('_tabs', array('type' => $type)); ?>
<?php $this->pageTitle = 'Create Payable Item'; ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::app()->basePath . '/javascripts/app.paymentVoucher.update.js'); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::getPathOfAlias('common') . '/javascripts/app.widgets.searchBillableParty.js'); ?>

<?php
$header = $type == PayableItem::COMM_TYPE_ADJUSTMENT ? 'New Adjustment Payable Item' : 'New Payable Item';
$this->breadcrumbs = array(
	'Commission Payable' => array('/commissionPayable/index'),
	$header
);
?>
<div class="flat_area">
	<div id="ps-payment-voucher-create" class="grid_16 relative">
		<?php
		if ($type == 'adjustment') {
			$this->renderPartial('_form', array(
				'payableItem' => $payableItem,
				'type' => $type
			));

			$this->renderPartial('_dialog_choosePayableItem', array(
				'dataProvider' => $dataProvider,
				'payableItemSearch' => $payableItemSearch
			));
		}
		?>


		<?php
		if ($type == 'new') {
			$this->renderPartial('_formNew', array(
				'payableItem' => $payableItem,
				'agency' => $agency,
				'type' => $type
			));
//			$this->renderPartial('_dialog_chooseParty', array(
//				'contactDataProvider' => $contactDataProvider,
//				'agentDataProvider' => $agentDataProvider,
//				'agencyDataProvider' => $agencyDataProvider
//				'searchContact' => $searchContact,
//				'searchAgent' => $searchAgent,
//				'searchAgency' => $searchAgency,
//			));
			$this->renderPartial('_dialog_chooseTransaction', array(
				'transactionDataProvider' => $transactionDataProvider,
				'searchPropertyCase' => $searchPropertyCase
			));
			$this->renderPartial('_dialog_chooseReceipt', array(
				'receiptDataProvider' => $receiptDataProvider,
				'searchReceipt' => $searchReceipt
			));
			
			
		}
		?>
	</div>
</div>